package com.rd.student.jike.class2.lihongming.week724_730.Day727;

import java.io.*;

/**
 * @Auther:Heinrich
 * @Date:2023/7/27-07-27-15:14
 * @Description:c230727
 * @version:1.0
 */
public class TestReader {
    public static void main(String[] args) throws Exception{
        File file = new File("stream.txt");
        Reader reader = new FileReader(file);
        char[] arr = new char[(int)(file.length())];
        reader.read(arr);
        System.out.println(new String(arr));
        reader.close();
        writer("Hello");
    }

    public static void writer(String str)throws Exception {
        File file = new File("stream.txt");
        Writer writer = new FileWriter(file);
        writer.write(str);
        writer.close();

    }
}
